
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>显示访问记录信息</title>
<!--#include file="inc/conn.asp"-->
<link href="css.css" type="text/css"  rel="stylesheet" />
<link href="index.css" type="text/css"  rel="stylesheet" />
<script type="text/javascript" src="commonjs/calendar.js"></script>
<script type="text/javascript" src="commonjs/calendar-cnutf8.js"></script>
<script type="text/javascript" src="commonjs/calendar-setup.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="commoncss/calendar-win2k-cold-2.css" title="win2k-cold-2" />

</head> 
<%
sd=Request.Form("startDate")
  ed=Request.Form("endDate")
  sql="select ip_addr,count(*) as ac,max(createdate) as  mcdate from   ipaccessrecord where 1=1"
  If( IsNull(sd)=false And sd<>"") Then
  sql= sql&"and createdate > #"&sd&"#"
  End if
 If( IsNull(ed)=false And ed<>"" ) Then
  sql= sql&"and createdate < #"&ed&"#"
  End If
  %>
<body>
<form name="form" action="" method="post">
<div class="font12" style="margin-left:10px;">时间: 从<input type="text" name="startDate" id="startDate" value="<%=sd%>"/> 到<input type="text" name="endDate" id="endDate" value="<%=ed%>"><br>
<input type="submit" value="查询" style="margin:5px 0px 0px 50px;"/>
</div>
<script type="text/javascript">
    Calendar.setup({
        inputField     :    "startDate",     // id of the input field
        ifFormat       :    "%Y-%m-%d",      // format of the input field
        align          :    "Tr",           // alignment (defaults to "Bl")
        singleClick    :    true,
		weekNumbers    :    false,
		 step           :    1 
    });
	 Calendar.setup({
        inputField     :    "endDate",     // id of the input field
        ifFormat       :    "%Y-%m-%d",      // format of the input field
        align          :    "Tr",           // alignment (defaults to "Bl")
        singleClick    :    true,
		weekNumbers    :    false,
		 step           :    1 
    });
</script>
</form>
  <%
  
  sql=sql&" group by ip_addr order by max(createdate) desc"
  dim rs
set rs=server.CreateObject("adodb.recordset")
rs.Open sql,objconn,1,3

if rs.eof and rs.bof then
response.Write("<font color='red'>暂时没有内容!</font>")
end if
%>

<table  class="tablec" width="400">
<tr>
<td>ip</td><td>访问次数</td><td>最近访问时间</td><td>操作</td>
</tr>
<%
Do While Not rs.eof

%>
<tr>
<td><%=rs("ip_addr")%></td>
<td><%=rs("ac")%></td>
<td><%=rs("mcdate")%></td>
<td><a href="access_detail.asp?ipadd=<%=rs("ip_addr")%>">详情</a>
</td>
</tr>
    <%
rs.MoveNext
loop

%>
</table>
</body>
</html>
